package com.ukao.cashregister.bean;

import com.ukao.cashregister.utils.CheckUtils;

import java.io.Serializable;
import java.util.List;

/**
 * Created by ukaodev on 2017/8/9.
 */

public class PayInfoBean extends  BaseBean<PayInfoBean> implements Serializable {

    /**
     * carriage : 1000
     * isEnableWx : true
     * isEnableAli : true
     * payablePrice : 18300
     * isEnableUnion : true
     * discount : 20
     * orderPrice : 1000
     * isEnableCash : true
     * userId : 114
     * modifyPrice : 18300
     */

    private  String  cpnRelId;  /*优惠券ID*/
    private  String   orderId ;
    private int carriage;
    private boolean isEnableWx;
    private boolean isEnableAli;
    private int payablePrice;
    private boolean isEnableUnion;
    private int discount;
    private int orderPrice;
    private boolean isEnableCash;
    private String userId;
    private Integer modifyPrice;
    private   int  balance;
    private   int payBalance;
    private    boolean  isUseUPay=false; /*是否使用优付卡*/
    private   int  shouldPrice=0;
    private  int  payStatus;/*0,代表可以支付*/
    private  int  couponAmt;/*使用的优惠券金额(如果有就返回)*/
    private boolean  isEnableOther; /*是否支持其实支付  多种卡支付*/
    private Integer cpnUseBalance;  //是否可以使用余额

    public Integer getCpnUseBalance() {
        if(cpnUseBalance==null){
            this.cpnUseBalance=1;
            return cpnUseBalance;
        }else {
            return cpnUseBalance;
        }
    }

    public void setCpnUseBalance(Integer cpnUseBalance) {
            this.cpnUseBalance = cpnUseBalance;

    }

    private    List<PaySignListBean>   paySignList;  /*银行卡列表*/

    public List<PaySignListBean> getPaySignList() {
        return paySignList;
    }

    public boolean isEnableOther() {
        return isEnableOther;
    }

    public String getCpnRelId() {
        return cpnRelId;
    }

    public void setCpnRelId(String cpnRelId) {
        this.cpnRelId = cpnRelId;
    }

    public boolean isUseUPay() {
        return isUseUPay;
    }

    private UPayCardBean uPayCard; /*优付款*/


    public UPayCardBean getUPayCard() {
        return uPayCard;
    }

    public void setUPayCard(UPayCardBean uPayCard) {
        this.uPayCard = uPayCard;
    }





    public boolean getPayStatus() {
        boolean  payStatusJump=false;
        if (payStatus==0){ /*是0就跳转*/
            payStatusJump=true;

        }

        return payStatusJump;
    }
    public void setCouponAmt(int couponAmt) {
        this.couponAmt = couponAmt;
    }

    public int getShouldPrice() {
        shouldPrice=CheckUtils.isNull(shouldPrice)?0 :shouldPrice;
        shouldPrice =shouldPrice<0?0:  shouldPrice;
        return  shouldPrice;
    }

    public void setUseUPay(boolean useUPay) {
        isUseUPay = useUPay;
    }

    public void setShouldPrice(int shouldPrice) {
        this.shouldPrice = shouldPrice;
    }
    public int getBalance() {
        return balance;
    }

    public void setPayBalance(int payBalance) {
        this.payBalance = payBalance;
    }

    public int getPayBalance() {
        return payBalance;
    }

    public int getCouponAmt() {
        return couponAmt;
    }
    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public int getCarriage() {
        return carriage;
    }

    public void setCarriage(int carriage) {
        this.carriage = carriage;
    }

    public boolean isIsEnableWx() {
        return isEnableWx;
    }

    public void setIsEnableWx(boolean isEnableWx) {
        this.isEnableWx = isEnableWx;
    }

    public boolean isIsEnableAli() {
        return isEnableAli;
    }

    public void setIsEnableAli(boolean isEnableAli) {
        this.isEnableAli = isEnableAli;
    }

    public int getPayablePrice() {
        return payablePrice;
    }

    public void setPayablePrice(int payablePrice) {
        this.payablePrice = payablePrice;
    }

    public boolean isIsEnableUnion() {
        return isEnableUnion;
    }

    public void setIsEnableUnion(boolean isEnableUnion) {
        this.isEnableUnion = isEnableUnion;
    }

    public int getDiscount() {
        return discount;
    }

    public void setDiscount(int discount) {
        this.discount = discount;
    }

    public int getOrderPrice() {
        return orderPrice;
    }

    public void setOrderPrice(int orderPrice) {
        this.orderPrice = orderPrice;
    }

    public boolean isIsEnableCash() {
        return isEnableCash;
    }

    public void setIsEnableCash(boolean isEnableCash) {
        this.isEnableCash = isEnableCash;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Integer getModifyPrice() {
        return modifyPrice;
    }

    public void setModifyPrice(int modifyPrice) {
        this.modifyPrice = modifyPrice;
    }
    public static class UPayCardBean   implements Serializable{
            /**
             * timeEnable : 0
             * balance : 1120
             * userCardRelId : 140
             * payRatio : 80
             * useCoupon : 1
             * rfidId : 308288
             * isEnable : 1
             * name : 优付卡支付
             */
            private int timeEnable;
            private int balance;
            private int userCardRelId;
            private int payRatio;
            private int useCoupon;
            private int rfidId;
            private int isEnable;
            private String name;

            public int getTimeEnable() {
                return timeEnable;
            }

            public void setTimeEnable(int timeEnable) {
                this.timeEnable = timeEnable;
            }

            public int getBalance() {
                return balance;
            }


            public int getUserCardRelId() {
                return userCardRelId;
            }

            public void setUserCardRelId(int userCardRelId) {
                this.userCardRelId = userCardRelId;
            }

            public int getPayRatio() {
                return payRatio;
            }

            public void setPayRatio(int payRatio) {
                this.payRatio = payRatio;
            }

            public boolean getUseCoupon() {  /*1代表可以使用优惠卷*/
                if (useCoupon==1){
                    return true;
                }
                return false;
            }

            public void setUseCoupon(int useCoupon) {
                this.useCoupon = useCoupon;
            }

            public int getRfidId() {
                return rfidId;
            }

            public void setRfidId(int rfidId) {
                this.rfidId = rfidId;
            }

            public boolean getIsEnable() {
                if (isEnable==1){
                    return  true;
                }
                return false;
            }

            public void setIsEnable(int isEnable) {
                this.isEnable = isEnable;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }
        }

    public static class  PaySignListBean implements Serializable   {
        private String val;
        private String showName;
        private String name;


        public String getVal() {
            return val;
        }

        public void setVal(String val) {
            this.val = val;
        }

        public String getShowName() {
            return showName;
        }

        public void setShowName(String showName) {
            this.showName = showName;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }


}
